﻿define(function (require, exports, module) {
    "require:nomunge,exports:nomunge,module:nomunge";
    var $ = require("jquery"),
        forimg = require("forimg")
    ;
    
    var init = function () {
        var $page = $("#page");

        if ($page.find(".slide").length) {
            new forimg.slide({
                forImgBoxEle: '.slide_con',
                forImgBoxListEle: ".flash_list",
                forImgItemEle: ".flash_item",
                interval:10000,
                callback: function () {
                    var _this = this,
                        i = this.forImgItem.length,
                        $indexBox = this.forImgBox.find(".count"), indexItem = [];
                    while (i--) {
                        indexItem[i] = '<span class="count_item"></span>';
                    }
                    $indexBox.empty().append(indexItem.join(''));
                    this.indexs = $indexBox.find('.count_item');
                    this.indexs.eq(0).addClass("curr");
                    this.indexs.hover(function () {
                        _this.setIndex(this);
                    });
                    this.automatic(true);
                    
                }
            });
        };
        bind();
    };

    var bind = function () {
        var $page = $("#page");


    };

    init();


   
});
